﻿using System;
using System.Collections.Generic;
using System.ServiceModel;
using Director.DomainModels;

namespace Director
{
	[ServiceContract(CallbackContract = typeof(IDirectorServiceCallback))]
	public interface IDirectorService
	{
		[OperationContract(IsOneWay = true)]
		void Disconnect();

		[OperationContract(IsOneWay = true)]
		void Connect();

		[OperationContract(IsOneWay = true)]
		void RequestHistoryData(string boardId, string secCode, int timeFrameId, bool fixMode);

		[OperationContract(IsOneWay = true)]
		void Ping();

		[OperationContract]
		IEnumerable<Security> GetSecurities();

		[OperationContract]
		IEnumerable<TimeFrame> GetTimeFrames();

		[OperationContract]
		IEnumerable<Market> GetMarkets();

		[OperationContract]
		IEnumerable<Board> GetBoards();

		[OperationContract]
		IEnumerable<Position> GetPositions();

		[OperationContract]
		IEnumerable<Candle> GetCandles(int securityId, int timeframeId, DateTime from);

		[OperationContract]
		EServiceState Hello();

		[OperationContract(IsOneWay = true)]
		void Bye();

		[OperationContract(IsOneWay = true)]
		void Subscribe(Security[] securities);

		[OperationContract(IsOneWay = true)]
		void SetMode(EServiceMode mode);

		[OperationContract]
		long Buy(int securityId, int quantity);

		[OperationContract]
		long Sell(int securityId, int quantity);

		[OperationContract]
		Candle GetLastCandle(int securityId, int timeframeId, DateTime lastOnDate);
	}
}
